
export default {
    mounted() {
        console.log(1111)
        this.bindGlobalButtonClickEvent();
    },
    methods: {
        bindGlobalButtonClickEvent() {
            const buttons = document.querySelectorAll('.el-button');
            console.log(buttons)

            buttons.forEach((button) => {
                console.log('forEach')

                button.addEventListener('click', this.handleGlobalButtonClick);
            });
        },
        handleGlobalButtonClick(e) {
            // 处理全局按钮点击事件
            console.log('handleGlobalButtonClick')
            let target = e.target
            if (target.nodeName === 'SPAN') { // span 标签
                target = e.target.parentNode
            }
            target.blur()

        },
    },
};
